package com.sogo;

import android.app.Activity;  
import android.os.Bundle;
import android.widget.Toast;
import android.database.Cursor;

public class DatabasesActivity extends Activity {
    /** Called when the activity is first created. */
    @Override
    public void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.main);
        
        DBAdapter db = new DBAdapter(this);
        
        db.open();
        long id = db.insertUser("aj53049", "password");
        
        Cursor c = db.getUser();
        if (c.moveToFirst())
        {
        	do{
        		DisplayUser(c);
        	}while (c.moveToNext());
        }
        db.close();
        
        
        	}
    
    	public void DisplayUser(Cursor c){
    		Toast.makeText(this,
    				"id: " + c.getString(0) + "\n" + "UserName: " + c.getString(1) + "\n" + 
    		 "Password: " + c.getString(2), Toast.LENGTH_LONG).show();
    	}
    
        }
        
    
